package com.base.service.impl;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;

import com.base.mapper.voipmapper.CallbackinfoesMapper;
import com.base.po.sqlparam.CallbackinfoesExamplePage;
import com.base.po.voip.Callbackinfoes;
import com.base.po.voip.CallbackinfoesExample;
import com.base.service.CallbackinfoesService;
import com.base.utils.Page;
import org.springframework.stereotype.Service;

@Service("callbackinfoesService")
public class CallbackinfoesServiceImpl implements CallbackinfoesService {
	@Autowired
	private CallbackinfoesMapper callbackinfoesMapper;

	@Override
	public int countByExample(CallbackinfoesExample example) {
		return callbackinfoesMapper.countByExample(example);
	}

	@Override
	public int deleteByExample(CallbackinfoesExample example) {
		return callbackinfoesMapper.deleteByExample(example);
	}

	@Override
	public int deleteByPrimaryKey(String id) {
		if (id == null) {
			return 0;
		}
		return callbackinfoesMapper.deleteByPrimaryKey(id);
	}

	@Override
	public int insert(String id, String caller, String calle164, Date calltime, String status, String parentid,
			String sysnum, Date fwdtime, Date endtime, BigDecimal money, BigDecimal omoney, Integer timecount,
			String shopid) {
		Callbackinfoes record = new Callbackinfoes(id, caller, calle164, calltime, status, parentid, sysnum, fwdtime,
				endtime, money, omoney, timecount, shopid);
		return callbackinfoesMapper.insert(record);
	}

	@Override
	public int insertSelective(Callbackinfoes record) {
		return callbackinfoesMapper.insertSelective(record);
	}

	@Override
	public List<Callbackinfoes> selectByExample(CallbackinfoesExample example) {
		return callbackinfoesMapper.selectByExample(example);
	}

	@Override
	public List<Callbackinfoes> selectByExamplePage(CallbackinfoesExamplePage example) {
		return callbackinfoesMapper.selectByExamplePage(example);
	}

	@Override
	public Callbackinfoes selectByPrimaryKey(String id) {
		if (id == null) {
			return null;
		}
		return callbackinfoesMapper.selectByPrimaryKey(id);
	}

	@Override
	public int updateByExampleSelective(Callbackinfoes record, CallbackinfoesExample example) {
		return callbackinfoesMapper.updateByExampleSelective(record, example);
	}

	@Override
	public int updateByExample(Callbackinfoes record, CallbackinfoesExample example) {
		if (record == null) {
			return 0;
		}
		if (record.getId() == null) {
			return 0;
		}
		return callbackinfoesMapper.updateByExample(record, example);
	}

	@Override
	public int updateByPrimaryKeySelective(Callbackinfoes record) {
		if (record == null) {
			return 0;
		}
		if (record.getId() == null) {
			return 0;
		}
		return callbackinfoesMapper.updateByPrimaryKeySelective(record);
	}

	@Override
	public int updateByPrimaryKey(Callbackinfoes record) {
		if (record == null) {
			return 0;
		}
		if (record.getId() == null) {
			return 0;
		}
		return callbackinfoesMapper.updateByPrimaryKey(record);
	}

	@Override
	public BigDecimal sumOmoneyParentID(String id) {
		return callbackinfoesMapper.sumOmoneyParentID(id);
	}

	@Override
	public BigDecimal sumOmoneyShopID(String id) {
		return callbackinfoesMapper.sumOmoneyShopID(id);
	}

	@Override
	public int countYearByParentID(String parentid, Date begin, Date end) {
		return callbackinfoesMapper.countYearByParentID(parentid, begin, end);
	}

	@Override
	public int countDzp(String parentid, String mobile, Date begintime, Date endtime) {
		return callbackinfoesMapper.countDzp(parentid, mobile, begintime, endtime);
	}

	@Override
	public Map<String, Object> countMoneyByParentID(String id, String datetime1, String datetime2) {
		return callbackinfoesMapper.countMoneyByParentID(id,datetime1,datetime2);
	}

	@Override
	public List<Callbackinfoes> selectAllByParentId(String parentid, String datetime1, String datetime2,Page page) {
		return callbackinfoesMapper.selectAllByParentId( parentid,  datetime1,  datetime2,page) ;
	}

	@Override
	public Map<String, Object> sumOmentyByMobile(String mobile, String pId) {
		return callbackinfoesMapper.sumOmentyByMobile( mobile,  pId);
	}

	@Override
	public List<Callbackinfoes> selectByCallerAndParentID(String caller, String parentid) {

		return callbackinfoesMapper.selectByCallerAndParentID(caller, parentid);
	}

	@Override
	public int countDayByParentID(String parentid, Date begin, Date end) {
		return callbackinfoesMapper.countDayByParentID(parentid, begin, end);
	}

	@Override
	public int countDayByShopID(String shopid, Date begin, Date end) {
		return callbackinfoesMapper.countDayByShopID(shopid, begin, end);
	}

	@Override
	public List<Callbackinfoes> selectByAll(Page page, String caller, String calle164, String dateFrom, String dateTo) {
		
		return callbackinfoesMapper.selectByAll(page, caller, calle164, dateFrom, dateTo);
	}

	@Override
	public int countByAll(String caller, String calle164, String dateFrom, String dateTo) {
		
		return callbackinfoesMapper.countByAll(caller, calle164, dateFrom, dateTo);
	}

	@Override
	public List<Callbackinfoes> selectByParentID(Page page, String parentid, String caller, String calle164,
			String dateFrom, String dateTo) {
		
		return callbackinfoesMapper.selectByParentID(page, parentid, caller, calle164, dateFrom, dateTo);
	}

	@Override
	public List<Callbackinfoes> selectByShopID(Page page, String shopid, String caller, String calle164, String dateFrom,
			String dateTo) {
		
		return callbackinfoesMapper.selectByShopID(page, shopid, caller, calle164, dateFrom, dateTo);
	}

	@Override
	public int countByParentID(String parentid, String caller, String calle164, String dateFrom, String dateTo) {
		
		return callbackinfoesMapper.countByParentID(parentid, caller, calle164, dateFrom, dateTo);
	}

	@Override
	public int countByShopID(String shopid, String caller, String calle164, String dateFrom, String dateTo) {
		
		return callbackinfoesMapper.countByShopID(shopid, caller, calle164, dateFrom, dateTo);
	}

	@Override
	public BigDecimal sumByParentID(String parentid, String caller, String calle164, String dateFrom, String dateTo) {
		return callbackinfoesMapper.sumByParentID(parentid, caller, calle164, dateFrom, dateTo);
	}
}
